using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TuMama;

namespace WindowsApplication2
{
    public partial class Subir_o_Jugar : Form
    {
        private Match match;

        public Subir_o_Jugar()
        {
            InitializeComponent();
            this.match = Match.thismatch;
            this.match.DoLogin += new EventHandler(match_DoLogin);
            this.match.DoWaiting += new EventHandler(match_DoWaiting);
            this.match.OkCancion += new EventHandler(match_OkCancion);
        }

        void match_OkCancion(object sender, EventArgs e)
        {
            this.Enabled = true;
            this.Visible = true;
            label2.Text = match.PlayerName;
            MessageBox.Show("Song Uploaded!");
        }

        void match_DoWaiting(object sender, EventArgs e)
        {
            this.Close();
        }

        void match_DoLogin(object sender, EventArgs e)
        {
            this.Enabled = true;
            this.Visible = true;
            label2.Text = match.PlayerName;
        }


        private void Subir_o_Jugar_Load(object sender, EventArgs e)
        {
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.MaximizeBox = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Mensaje nuevo = new Mensaje(null, Mensaje.tipoObjeto.NULL, Mensaje.message.waiting);
            match.SendMessage(nuevo);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SubirArchivo subir = new SubirArchivo();
            this.Hide();
            subir.Show();
          
        }
    }
}